package com.itheima.mobile.controller;

import com.itheima.common.entity.Result;
import com.itheima.mobile.dto.OrderDto;
import com.itheima.mobile.service.IOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private IOrderService orderService;

    @PostMapping("/submitOrder")
    public Result submitOrder(@RequestBody OrderDto orderDto) {
        return orderService.submitOrder(orderDto);
    }

    @PostMapping("/findById")
    public Result findById(@RequestParam("id") String id){
        return orderService.findById(id);
    }
}
